<?php

    class ApartmanBookingFormStep1 extends sfForm
    {
      public function configure()
      {
        $this->setWidgets( array(
                'title'         => new sfWidgetFormSelect( array( 'choices' => array( __('please select'), 'mr' => 'Mr.', 'mrs' => 'Mrs.', 'ms' => 'Ms.', 'dr' => 'Dr.' ) ) ),            
                'first_name'    => new sfWidgetFormInput(),
                'last_name'     => new sfWidgetFormInput(),
                'birth_name'    => new sfWidgetFormInput(),                
                'email'         => new sfWidgetFormInput(),
                'phone'         => new sfWidgetFormInput(),
                'cellphone'     => new sfWidgetFormInput(),
                'fax'           => new sfWidgetFormInput(),
                'address'       => new sfWidgetFormTextarea(),
                'city'          => new sfWidgetFormInput(),
                'state'         => new sfWidgetFormInput(),
                'country'       => new sfWidgetFormInput(),
                'zip'           => new sfWidgetFormInput(),
        ));
        
        $this->setValidators( array(
                'title'         => new sfValidatorString(array('max_length' => 5, 'required' => true)),
                'first_name'    => new sfValidatorString(array('max_length' => 50, 'required' => true)),
                'last_name'     => new sfValidatorString(array('max_length' => 50, 'required' => true)),
                'birth_name'    => new sfValidatorString(array('max_length' => 50, 'required' => true)),                
                'email'         => new sfValidatorEmail(array('required' => true)),
                'phone'         => new sfValidatorString(array('max_length' => 20, 'required' => true)),
                'cellphone'     => new sfValidatorString(array('max_length' => 20, 'required' => true)),
                'fax'           => new sfValidatorString(array('max_length' => 20, 'required' => false)),
                'address'       => new sfValidatorString(array('max_length' => 255, 'required' => true)),
                'city'          => new sfValidatorString(array('max_length' => 100, 'required' => true)),
                'state'         => new sfValidatorString(array('max_length' => 50, 'required' => true)),
                'country'       => new sfValidatorString(array('max_length' => 50, 'required' => true)),
                'zip'           => new sfValidatorString(array('max_length' => 20, 'required' => true)),            
        ));
        
        $this->widgetSchema->setNameFormat('booking_step1[%s]');
    
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);        
      }
    }
    
?>
